<template>
  <div ref="dashboard" style="width: 600px;height:400px;"></div>
  <SimpleUpload></SimpleUpload>
  <drop-upload></drop-upload>
  <simple-tree></simple-tree>
  <tiny-mce></tiny-mce>
</template>

<script lang="ts" setup>
import * as echarts from 'echarts';
import {useRoute, useRouter} from 'vue-router';
import {onMounted, ref} from "vue";
import SimpleUpload from "@/components/Upload/SimpleUpload.vue";
import DropUpload from "@/components/Upload/DropUpload.vue";
import SimpleTree from "@/components/Tree/SimpleTree.vue";
import TinyMce from "@/components/Tinymce/TinyMce.vue";

const route = useRoute();
const routes = useRouter();

const getRoute = () => {

  let {path} = route
  // 全部路由数据
  let data = routes.options.routes
  console.log("当前路由:", path, route)
  console.log("全部路由:", data, routes)
}

const dashboard = ref()

// 组件渲染时执行
onMounted(() => {
  // 基于准备好的dom，初始化echarts实例
  const myChart = echarts.init(dashboard.value);
  // 绘制图表
  myChart.setOption({
    title: {
      text: 'ECharts 入门示例'
    },
    tooltip: {},
    xAxis: {
      data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
    },
    yAxis: {},
    series: [
      {
        name: '销量',
        type: 'bar',
        data: [5, 20, 36, 10, 10, 20]
      }
    ]
  });
})

</script>

<style lang="less" scoped>

</style>
